GBML manual / Link Cable

link_dy

The vertical axis of a player’s d-pad, like btn_dy but for any player on the link cable: -1 (Up), 0, or 1 (Down). Both held at once cancels to 0, and a player who is not there is 0.

Works differently on Game Boy - The Game Boy link cable joins two consoles, not four: players 3 and 4 are never there and read as not pressing anything, and the two consoles decide between themselves which one is player 1, so it can be a different one each time they meet.

Works differently on Game Boy Color - The Game Boy Color link cable joins two consoles, not four: players 3 and 4 are never there and read as not pressing anything, and the two consoles decide between themselves which one is player 1, so it can be a different one each time they meet.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

link_dy(player) -> int

Arguments

NameType
playerint

Returns

int

Description

The vertical axis of player player's d-pad, read as a single number: -1 while Up is held, 1 while Down is held, 0 otherwise. Holding both at once cancels back to 0. It is btn_dy for any player on the link cable. The y axis is -1 for Up because on screen, y grows downward.

A player who is not there, or a number that is not a player, is 0.

Example

y += link_dy(2) * 2;

Moves this square up and down with player 2's d-pad, on both consoles.

See also: link_dxbtn_dylink_button_heldThe link cable